#ifndef __WAVCHUNKS_H__
#define __WAVCHUNKS_H__

#define CHUNK_COMMON char id[4]; int size;

typedef struct _WavChunk
{
  CHUNK_COMMON

  char data[4];
} WavChunk;

typedef struct _RiffChunk
{
  CHUNK_COMMON

  char wave_id[4];
  char next_chunk[4];
} RiffChunk;

typedef struct _FmtChunk
{
  CHUNK_COMMON

  short w_format_tag;
  short num_channels;
  int num_samples_per_sec;
  int num_avg_bytes_per_sec;
  short num_block_align;
  short w_bits_per_sample;
  char extension_data[4];
} FmtChunk;

#define WAVE_FORMAT_PCM 0x0001
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
#define WAVE_FORMAT_ALAW 0x0006
#define WAVE_FORMAT_MULAW 0x0007
#define WAVE_FORMAT_EXTENSIBLE 0xfffe

typedef struct _DataChunk
{
  CHUNK_COMMON

  char data[1];
} DataChunk;

#endif
